﻿#include "AVLTree.h"
#include <vector>
int main()
{
	//AVLTree<int, int> tree;
	//int arr[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
	//int arr[] = { 4, 2, 6, 1, 3, 5, 15, 7, 16, 14 };
	//for (auto e : arr)
	//{
	//	tree.Insert(make_pair(e, e));
	//	std::cout << "Insert: " << e << "->" << tree.IsBalance() << std::endl;
	//}
	const int N = 10000;
	vector<int> v;
	v.reserve(N);
	srand(time(0));
	for (size_t i = 0; i < N; i++)
	{
		v.push_back(rand());
	}
	AVLTree<int, int> tree;
	for (auto e : v)
	{
		tree.Insert(make_pair(e,e));
		std::cout << "Insert: " << e << "->" << tree.IsBalance() << std::endl;
	}

	return 0;
}